<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .select{border: solid 1px black;width:200px;}
        .select ul{display:none}

    </style>
</head>
<body>

    <select>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
    </select>

    <div class="select">
        <span>显示区域</span>
        <ul>
            <li>选项1</li>
            <li>选项2</li>
            <li>选项3</li>
            <li>选项4</li>
            <li>选项5</li>
            <li>选项6</li>
        </ul>
    </div>

</body>
<script>

    var select = document.querySelector(".select")
    var list = document.querySelector(".select ul")

    select.onclick = function(eve){
        var e = eve || window.event;

        list.style.display = "block";

        // 阻止冒泡
        // 正常：
        // e.stopPropagation();
        // IE低版本：
        // e.cancelBubble = true;

        // 阻止事件冒泡的兼容封装
        stopBubble(e);
    }
    
    document.onclick = function(){
        list.style.display = "none";
    }


    function stopBubble(e){
        if(e.stopPropagation){
            e.stopPropagation();
        }else{
            e.cancelBubble = true;
        }
    }
    
</script>
</html>